#!/bin/bash

# Annotation Provider Startup Script
# Author: BCXJ
# Version: 1.0

echo "================================================="
echo "Starting Dubbo Annotation Provider..."
echo "================================================="

cd "$(dirname "$0")/demo-dubbo-service"

# Check if Zookeeper is running
echo "Checking Zookeeper connection..."
nc -z 192.168.1.150 2181
if [ $? -ne 0 ]; then
    echo "ERROR: Zookeeper is not running on 192.168.1.150:2181"
    echo "Please start Zookeeper first!"
    exit 1
fi

echo "Zookeeper is running..."
echo ""

# Start the provider
mvn exec:java -Dexec.mainClass="org.example.provider.AnnotationProviderApplication"

